<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>添加家庭成员</title>
	<jsp:include page="common/_js.jsp"></jsp:include>
	<script type="text/javascript">
	$(document).ready(function(){
		$("#addfd").click(function(){
			var size=$("fieldset").size();
			var fieldset=$("<fieldset id='g"+size+"'></fieldset>");
			fieldset.append($("#g0").html()).appendTo($("form")).after($(":submit"));
			$("label","#g"+size).each(function(){
				$(this).attr("for",$(this).attr("for").replace("0",size));
			});
			$("input","#g"+size).each(function(){
				$(this).attr("id",$(this).attr("id").replace("0",size));
				$(this).attr("name",$(this).attr("name").replace("0",size));
			});
		});
		
		$("#cancel").click(function(){
			var size=$("fieldset").size()-1;
			if(size>0){
				$("#g"+size).remove();
			}
		});
		
	});
	</script>
</head>
<body>
	添加导游领队家庭成员<s:property value="#parameters.guideId"/>
	<s:property value="#guideId"/>  <a id="addfd">添加成员</a><br><a id="cancel">取消</a>
	<s:form action="guidefmAction!insertGuidefm.jspa" namespace="/com" >
		<fieldset id="g0">
			<s:hidden name="guidefmList[0].guideId" value="%{#parameters.guideId}"></s:hidden>
			<s:textfield theme="xhtml" label="姓名"		name="guidefmList[0].name"></s:textfield>
			<s:textfield theme="xhtml" label="成员关系" 	name="guidefmList[0].relative"></s:textfield>
			<s:textfield theme="xhtml" label="生日" 		name="guidefmList[0].birthday"></s:textfield>
			<s:textfield theme="xhtml" label="工作单位"	name="guidefmList[0].workUnit"></s:textfield>
			<s:textfield theme="xhtml" label="职业"		name="guidefmList[0].career"></s:textfield>
			<s:textfield theme="xhtml" label="联系电话"	name="guidefmList[0].phonenum"></s:textfield>
		</fieldset>
		<s:submit value="提交"></s:submit>
	</s:form>
</body>
</html>